#include "setupdlg.h"

#include "boost/foreach.hpp"

#include "utils/traceur.h"

#define foreach BOOST_FOREACH


/**
* Called by the framework when the dialog is being initialized
*
* @param event
*/
void DlgAddChild::OnInitDialog( wxInitDialogEvent& event )
{
	// Fill the available children list
	foreach (const std::string& sChild, m_lstChildName)
	{
		m_choiceElement->Append(sChild.c_str());
	}
	m_choiceElement->SetSelection(0);
}

/**
* Called when the user clicked on the OK button.
*  It must save the child name and close the dialog
*
* @param event
*/
void DlgAddChild::OnOK( wxCommandEvent& event )
{
    m_sChild = m_choiceElement->GetStringSelection().c_str();

    EndModal(wxID_OK);
}
